< previous page page_748 next page >

Page 748
Write a For...Next loop that loops from 1 to 100 and only prints the value 50 when the loop variable becomes 50.
Answer:
9f31265bb40b592b1929e18a47ab28e5.gif
For intLoop = 1 To 100
   If intLoop = 50 Then
      Print intLoop
   End If
Next
Chapter 9: Procedures and Functions
True or false? You may use a letter or underscore as the first character for a procedure name.
Answer: True.
Whats the file extension used for code modules?
Answer: BAS.
True or false? Global variables are declared in the declarations section of code modules or forms.
Answer: False. They need to be declared in BAS modules.
In the following code:
9f31265bb40b592b1929e18a47ab28e5.gif
Dim intTemp As Integer
Dim strName As String
intTemp = 5
strName = " Bill" 
Call Proc1(intTemp, strName)
Me.Print intTemp
Me.Print strName
Sub Proc1(intParm As Integer, strValue As String)
   intParm = 10
   strValue = " Hi There" 
End Sub
For Me.Print intTemp, what is displayed?
Answer: 10.

 
< previous page page_748 next page >

If you like this book, buy it!